package com.deviche.gank;

import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by h on 2018/4/24.
 */

public class ImageAdapter extends BaseQuickAdapter<ImageBean.ResultsBean, BaseViewHolder> {

    public ImageAdapter(int layoutResId, ArrayList<ImageBean.ResultsBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, ImageBean.ResultsBean item) {
        //helper.setText(R.id.text, item.getTitle());
        //helper.setImageResource(R.id.icon, item.getImageResource());
        // 加载网络图片
        Glide.with(mContext).load(item.getUrl()).crossFade().into((ImageView) helper.getView(R.id.iv));
    }
}

